<template>
    <div class='view-container'>
    <row class="app-layoutpanel">
        <div class="app-layoutpanel-container" style="">
            <div style="height:100%;display: flex;flex-direction: column;">
                
                <div style="" class="app-layoutpanel-field ">
                    <div class="item-field">
                    <span class="item-field-label ">活动类型</span>
                    <div class="item-field-content">
                    <span>{{data.activity_type_id_text}}</span>
                    </div>
                </div>
                
                
                </div>
                <div class="app-layoutpanel-container" style="">
                    <div style="height:100%;display: flex;justify-content: flex-start;">
                        
                        <div style="flex-grow: 1;" class="app-layoutpanel-field ">
                            <div class="item-field">
                            <span class="item-field-label ">创建时间</span>
                            <div class="item-field-content">
                            <span>{{data.write_date}}</span>
                            </div>
                        </div>
                        
                        
                        </div>
                        
                        <div style="flex-grow: 1;" class="app-layoutpanel-field ">
                            <div class="item-field">
                            <span class="item-field-label ">创建人</span>
                            <div class="item-field-content">
                            <span>{{data.create_user_id_text}}</span>
                            </div>
                        </div>
                        
                        
                        </div>
                    </div>
                </div>
                
                <div style="" class="app-layoutpanel-field ">
                    <div class="item-field">
                    <span class="item-field-label ">分派给</span>
                    <div class="item-field-content">
                    <span>{{data.user_id_text}}</span>
                    </div>
                </div>
                
                
                </div>
                
                <div style="" class="app-layoutpanel-field ">
                    <div class="item-field">
                    <span class="item-field-label ">到期时间</span>
                    <div class="item-field-content">
                    <span>{{data.date_deadline}}</span>
                    </div>
                </div>
                
                
                </div>
            </div>
        </div>
    </row>
</div>
</template>
<script lang='tsx'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils';
import Mail_activityService from '@/service/mail-activity/mail-activity-service';
import ListService from './list-panel-service';



@Component({
    components: {
      
    }
})
export default class ListBase extends Vue implements ControlInterface {

    /**
     * 名称
     *
     * @type {string}
     * @memberof List
     */
    @Prop() public name?: string;

    /**
     * 视图通讯对象
     *
     * @type {Subject<ViewState>}
     * @memberof List
     */
    @Prop() public viewState!: Subject<ViewState>;

    /**
     * 应用上下文
     *
     * @type {*}
     * @memberof List
     */
    @Prop() public context: any;

    /**
     * 视图参数
     *
     * @type {*}
     * @memberof List
     */
    @Prop() public viewparams: any;

    /**
     * 视图状态事件
     *
     * @public
     * @type {(Subscription | undefined)}
     * @memberof List
     */
    public viewStateEvent: Subscription | undefined;

    /**
     * 获取部件类型
     *
     * @returns {string}
     * @memberof List
     */
    public getControlType(): string {
        return 'PANEL'
    }



    /**
     * 计数器服务对象集合
     *
     * @type {Array<*>}
     * @memberof List
     */    
    public counterServiceArray:Array<any> = [];

    /**
     * 建构部件服务对象
     *
     * @type {ListService}
     * @memberof List
     */
    public service: ListService = new ListService({ $store: this.$store });

    /**
     * 实体服务对象
     *
     * @type {Mail_activityService}
     * @memberof List
     */
    public appEntityService: Mail_activityService = new Mail_activityService({ $store: this.$store });
    


    /**
     * 关闭视图
     *
     * @param {any} args
     * @memberof List
     */
    public closeView(args: any): void {
        let _this: any = this;
        _this.$emit('closeview', [args]);
    }

    /**
     *  计数器刷新
     *
     * @memberof List
     */
    public counterRefresh(){
        const _this:any =this;
        if(_this.counterServiceArray && _this.counterServiceArray.length >0){
            _this.counterServiceArray.forEach((item:any) =>{
                if(item.refreshData && item.refreshData instanceof Function){
                    item.refreshData();
                }
            })
        }
    }


    /**
     * 接口实现
     *
     * @returns {any[]}
     * @memberof List
     */
    getDatas(): any[] {
        if (!this.data) {
            return [];
        }
        return [this.data];
    }
    getData() {
        return this.data;
    }

    /**
     * 面板数据对象
     *
     * @type {*}
     * @memberof List
     */
    @Prop() public data?: any;


}
</script>

<style lang='less'>
@import './list-panel.less';
</style>

